{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "4606b171",
   "metadata": {},
   "source": [
    "### 上周学习内容\n",
    "* python的第一行代码\n",
    "\n",
    "#### 重要资源：\n",
    "> [python官网](https://python.com)  \n",
    "\n",
    "> [blobs](https://cnblogs.com/xuzhichao)\n",
    "\n",
    "## 本周学习内容\n",
    "\n",
    "### 1.python环境配置\n",
    "* A.[pycharm](https://www.jetbrains.com/pycharm/)\n",
    "> a.项目管理的IDE  \n",
    "> b.[github education pack](https://education.github.com/pack)可免费获取一年 专业版使用\n",
    "\n",
    "### 2.项目1：奇数中选择指定时间"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "097ae93e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This minute seems a little odd.\n"
     ]
    }
   ],
   "source": [
    " from datetime import datetime\n",
    " \n",
    " odds = [  1, 3,  5,  7,  9, 11,13,15,17,19\n",
    "             ,21,23,25,27,29,31,33,35,37,39\n",
    "             ,41,43,45,47,49,51,53,55,57,59]    \n",
    " \n",
    " right_this_minute = datetime.today().minute\n",
    " \n",
    " if right_this_minute in odds:\n",
    "    print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "    print(\"Not an odd minute.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "8dcb41a4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "37"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.today().minute"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "889c8224",
   "metadata": {},
   "source": [
    "### 3.变量（数字，字符串，对象）\n",
    "##### 3.1数字"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "81ce748b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    ">>> 2 + 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "1f66704a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10.0"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    ">>> (50-5*6)/2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "e06a42a4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"doesn't\""
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"doesn't\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d9bf6f75",
   "metadata": {},
   "source": [
    "##### 3.2字符串"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "fbc3c35d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"doesn't\""
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"doesn't\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "bab6cff0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'spam eggs'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " 'spam eggs'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "4bd511b9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\"Yes,\" they said.'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'\"Yes,\" they said.'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "cdf0369c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\"Yes,\" they said.'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"\\\"Yes,\\\" they said.\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "1c234c50",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\"Isn\\'t,\" they said.'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'\"Isn\\'t,\" they said.'"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9c12cc5b",
   "metadata": {},
   "source": [
    "##### 3.3对象\n",
    "在Python中，一切都是对象"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "09e6f1c8",
   "metadata": {},
   "source": [
    "### 4.if and else"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "bb0f768b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Not an odd minute.\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59]\n",
    "\n",
    "right_this_second = datetime.today().second\n",
    "if right_this_second in odds: ###此“if”语句结果为“true\"或“false”\n",
    "    print(\"This minute seems a little odd.\")###这是一个代码块（是缩进的）\n",
    "else:###“else”语句，指示当对应的“if”语句返回一个false值时要执行的代码块\n",
    "    print(\"Not an odd minute.\")###这也是一个代码块（是缩进的）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fbc6fa8d",
   "metadata": {},
   "source": [
    "#### 课本代码\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "7fc09a88",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.date(2021, 10, 6)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import datetime\n",
    "datetime.date.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "a04307aa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "6"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today().day"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "754e4071",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today().month\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "43c93572",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2021"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today().year\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "d71af202",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2021-10-06'"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.isoformat(datetime.date.today())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "cb9dc909",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'22:55'"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import time\n",
    "time.strftime(\"%H:%M\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "294d708d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'10:06'"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.strftime(\"%m:%d\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c585346a",
   "metadata": {},
   "source": [
    "#### for"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "72c1fbdf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "2\n",
      "3\n"
     ]
    }
   ],
   "source": [
    "for i in [1,2,3]:\n",
    "        print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "ca0ce398",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "h\n",
      "i\n",
      "!\n"
     ]
    }
   ],
   "source": [
    "for ch in \"hi!\":\n",
    "        print(ch)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "e5c67e99",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I am Iron Man\n",
      "I am Iron Man\n",
      "I am Iron Man\n",
      "I am Iron Man\n",
      "I am Iron Man\n"
     ]
    }
   ],
   "source": [
    "for num in range(5):\n",
    "        print('I am Iron Man')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "75089d39",
   "metadata": {},
   "source": [
    "#### range"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "e6fb5e34",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "range(0, 5)"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "range(5) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "c17f7637",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0, 1, 2, 3, 4]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(5))###将“range”的输出输入到“list”中会生成一个列表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "08746b11",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[5, 6, 7, 8, 9]"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(5,10))###可以调整“range”的START和STOP值\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "141dbbc4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0, 2, 4, 6, 8]"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(0,10,2))###可以调整STEP值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "46027442",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[10, 8, 6, 4, 2]"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(10,0,-2))###通过设置STEP为负值来调整范围方向"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "e4ad53d3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[]"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(10,0,2))###如果START值大于STOP值，而STEP为正值，将得不到什么结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "beba169d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[99,\n",
       " 98,\n",
       " 97,\n",
       " 96,\n",
       " 95,\n",
       " 94,\n",
       " 93,\n",
       " 92,\n",
       " 91,\n",
       " 90,\n",
       " 89,\n",
       " 88,\n",
       " 87,\n",
       " 86,\n",
       " 85,\n",
       " 84,\n",
       " 83,\n",
       " 82,\n",
       " 81,\n",
       " 80,\n",
       " 79,\n",
       " 78,\n",
       " 77,\n",
       " 76,\n",
       " 75,\n",
       " 74,\n",
       " 73,\n",
       " 72,\n",
       " 71,\n",
       " 70,\n",
       " 69,\n",
       " 68,\n",
       " 67,\n",
       " 66,\n",
       " 65,\n",
       " 64,\n",
       " 63,\n",
       " 62,\n",
       " 61,\n",
       " 60,\n",
       " 59,\n",
       " 58,\n",
       " 57,\n",
       " 56,\n",
       " 55,\n",
       " 54,\n",
       " 53,\n",
       " 52,\n",
       " 51,\n",
       " 50,\n",
       " 49,\n",
       " 48,\n",
       " 47,\n",
       " 46,\n",
       " 45,\n",
       " 44,\n",
       " 43,\n",
       " 42,\n",
       " 41,\n",
       " 40,\n",
       " 39,\n",
       " 38,\n",
       " 37,\n",
       " 36,\n",
       " 35,\n",
       " 34,\n",
       " 33,\n",
       " 32,\n",
       " 31,\n",
       " 30,\n",
       " 29,\n",
       " 28,\n",
       " 27,\n",
       " 26,\n",
       " 25,\n",
       " 24,\n",
       " 23,\n",
       " 22,\n",
       " 21,\n",
       " 20,\n",
       " 19,\n",
       " 18,\n",
       " 17,\n",
       " 16,\n",
       " 15,\n",
       " 14,\n",
       " 13,\n",
       " 12,\n",
       " 11,\n",
       " 10,\n",
       " 9,\n",
       " 8,\n",
       " 7,\n",
       " 6,\n",
       " 5,\n",
       " 4,\n",
       " 3,\n",
       " 2,\n",
       " 1]"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(99,0,-1))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e4978f00",
   "metadata": {},
   "source": [
    "### 啤酒歌谣"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "78e09dcc",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "99 bottles of beer on the wall.\n",
      "99 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "98 bottles of beer on the wall.\n",
      "\n",
      "98 bottles of beer on the wall.\n",
      "98 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "97 bottles of beer on the wall.\n",
      "\n",
      "97 bottles of beer on the wall.\n",
      "97 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "96 bottles of beer on the wall.\n",
      "\n",
      "96 bottles of beer on the wall.\n",
      "96 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "95 bottles of beer on the wall.\n",
      "\n",
      "95 bottles of beer on the wall.\n",
      "95 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "94 bottles of beer on the wall.\n",
      "\n",
      "94 bottles of beer on the wall.\n",
      "94 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "93 bottles of beer on the wall.\n",
      "\n",
      "93 bottles of beer on the wall.\n",
      "93 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "92 bottles of beer on the wall.\n",
      "\n",
      "92 bottles of beer on the wall.\n",
      "92 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "91 bottles of beer on the wall.\n",
      "\n",
      "91 bottles of beer on the wall.\n",
      "91 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "90 bottles of beer on the wall.\n",
      "\n",
      "90 bottles of beer on the wall.\n",
      "90 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "89 bottles of beer on the wall.\n",
      "\n",
      "89 bottles of beer on the wall.\n",
      "89 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "88 bottles of beer on the wall.\n",
      "\n",
      "88 bottles of beer on the wall.\n",
      "88 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "87 bottles of beer on the wall.\n",
      "\n",
      "87 bottles of beer on the wall.\n",
      "87 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "86 bottles of beer on the wall.\n",
      "\n",
      "86 bottles of beer on the wall.\n",
      "86 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "85 bottles of beer on the wall.\n",
      "\n",
      "85 bottles of beer on the wall.\n",
      "85 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "84 bottles of beer on the wall.\n",
      "\n",
      "84 bottles of beer on the wall.\n",
      "84 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "83 bottles of beer on the wall.\n",
      "\n",
      "83 bottles of beer on the wall.\n",
      "83 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "82 bottles of beer on the wall.\n",
      "\n",
      "82 bottles of beer on the wall.\n",
      "82 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "81 bottles of beer on the wall.\n",
      "\n",
      "81 bottles of beer on the wall.\n",
      "81 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "80 bottles of beer on the wall.\n",
      "\n",
      "80 bottles of beer on the wall.\n",
      "80 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "79 bottles of beer on the wall.\n",
      "\n",
      "79 bottles of beer on the wall.\n",
      "79 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "78 bottles of beer on the wall.\n",
      "\n",
      "78 bottles of beer on the wall.\n",
      "78 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "77 bottles of beer on the wall.\n",
      "\n",
      "77 bottles of beer on the wall.\n",
      "77 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "76 bottles of beer on the wall.\n",
      "\n",
      "76 bottles of beer on the wall.\n",
      "76 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "75 bottles of beer on the wall.\n",
      "\n",
      "75 bottles of beer on the wall.\n",
      "75 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "74 bottles of beer on the wall.\n",
      "\n",
      "74 bottles of beer on the wall.\n",
      "74 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "73 bottles of beer on the wall.\n",
      "\n",
      "73 bottles of beer on the wall.\n",
      "73 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "72 bottles of beer on the wall.\n",
      "\n",
      "72 bottles of beer on the wall.\n",
      "72 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "71 bottles of beer on the wall.\n",
      "\n",
      "71 bottles of beer on the wall.\n",
      "71 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "70 bottles of beer on the wall.\n",
      "\n",
      "70 bottles of beer on the wall.\n",
      "70 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "69 bottles of beer on the wall.\n",
      "\n",
      "69 bottles of beer on the wall.\n",
      "69 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "68 bottles of beer on the wall.\n",
      "\n",
      "68 bottles of beer on the wall.\n",
      "68 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "67 bottles of beer on the wall.\n",
      "\n",
      "67 bottles of beer on the wall.\n",
      "67 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "66 bottles of beer on the wall.\n",
      "\n",
      "66 bottles of beer on the wall.\n",
      "66 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "65 bottles of beer on the wall.\n",
      "\n",
      "65 bottles of beer on the wall.\n",
      "65 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "64 bottles of beer on the wall.\n",
      "\n",
      "64 bottles of beer on the wall.\n",
      "64 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "63 bottles of beer on the wall.\n",
      "\n",
      "63 bottles of beer on the wall.\n",
      "63 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "62 bottles of beer on the wall.\n",
      "\n",
      "62 bottles of beer on the wall.\n",
      "62 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "61 bottles of beer on the wall.\n",
      "\n",
      "61 bottles of beer on the wall.\n",
      "61 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "60 bottles of beer on the wall.\n",
      "\n",
      "60 bottles of beer on the wall.\n",
      "60 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "59 bottles of beer on the wall.\n",
      "\n",
      "59 bottles of beer on the wall.\n",
      "59 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "58 bottles of beer on the wall.\n",
      "\n",
      "58 bottles of beer on the wall.\n",
      "58 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "57 bottles of beer on the wall.\n",
      "\n",
      "57 bottles of beer on the wall.\n",
      "57 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "56 bottles of beer on the wall.\n",
      "\n",
      "56 bottles of beer on the wall.\n",
      "56 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "55 bottles of beer on the wall.\n",
      "\n",
      "55 bottles of beer on the wall.\n",
      "55 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "54 bottles of beer on the wall.\n",
      "\n",
      "54 bottles of beer on the wall.\n",
      "54 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "53 bottles of beer on the wall.\n",
      "\n",
      "53 bottles of beer on the wall.\n",
      "53 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "52 bottles of beer on the wall.\n",
      "\n",
      "52 bottles of beer on the wall.\n",
      "52 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "51 bottles of beer on the wall.\n",
      "\n",
      "51 bottles of beer on the wall.\n",
      "51 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "50 bottles of beer on the wall.\n",
      "\n",
      "50 bottles of beer on the wall.\n",
      "50 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "49 bottles of beer on the wall.\n",
      "\n",
      "49 bottles of beer on the wall.\n",
      "49 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "48 bottles of beer on the wall.\n",
      "\n",
      "48 bottles of beer on the wall.\n",
      "48 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "47 bottles of beer on the wall.\n",
      "\n",
      "47 bottles of beer on the wall.\n",
      "47 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "46 bottles of beer on the wall.\n",
      "\n",
      "46 bottles of beer on the wall.\n",
      "46 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "45 bottles of beer on the wall.\n",
      "\n",
      "45 bottles of beer on the wall.\n",
      "45 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "44 bottles of beer on the wall.\n",
      "\n",
      "44 bottles of beer on the wall.\n",
      "44 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "43 bottles of beer on the wall.\n",
      "\n",
      "43 bottles of beer on the wall.\n",
      "43 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "42 bottles of beer on the wall.\n",
      "\n",
      "42 bottles of beer on the wall.\n",
      "42 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "41 bottles of beer on the wall.\n",
      "\n",
      "41 bottles of beer on the wall.\n",
      "41 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "40 bottles of beer on the wall.\n",
      "\n",
      "40 bottles of beer on the wall.\n",
      "40 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "39 bottles of beer on the wall.\n",
      "\n",
      "39 bottles of beer on the wall.\n",
      "39 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "38 bottles of beer on the wall.\n",
      "\n",
      "38 bottles of beer on the wall.\n",
      "38 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "37 bottles of beer on the wall.\n",
      "\n",
      "37 bottles of beer on the wall.\n",
      "37 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "36 bottles of beer on the wall.\n",
      "\n",
      "36 bottles of beer on the wall.\n",
      "36 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "35 bottles of beer on the wall.\n",
      "\n",
      "35 bottles of beer on the wall.\n",
      "35 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "34 bottles of beer on the wall.\n",
      "\n",
      "34 bottles of beer on the wall.\n",
      "34 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "33 bottles of beer on the wall.\n",
      "\n",
      "33 bottles of beer on the wall.\n",
      "33 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "32 bottles of beer on the wall.\n",
      "\n",
      "32 bottles of beer on the wall.\n",
      "32 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "31 bottles of beer on the wall.\n",
      "\n",
      "31 bottles of beer on the wall.\n",
      "31 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "30 bottles of beer on the wall.\n",
      "\n",
      "30 bottles of beer on the wall.\n",
      "30 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "29 bottles of beer on the wall.\n",
      "\n",
      "29 bottles of beer on the wall.\n",
      "29 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "28 bottles of beer on the wall.\n",
      "\n",
      "28 bottles of beer on the wall.\n",
      "28 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "27 bottles of beer on the wall.\n",
      "\n",
      "27 bottles of beer on the wall.\n",
      "27 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "26 bottles of beer on the wall.\n",
      "\n",
      "26 bottles of beer on the wall.\n",
      "26 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "25 bottles of beer on the wall.\n",
      "\n",
      "25 bottles of beer on the wall.\n",
      "25 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "24 bottles of beer on the wall.\n",
      "\n",
      "24 bottles of beer on the wall.\n",
      "24 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "23 bottles of beer on the wall.\n",
      "\n",
      "23 bottles of beer on the wall.\n",
      "23 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "22 bottles of beer on the wall.\n",
      "\n",
      "22 bottles of beer on the wall.\n",
      "22 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "21 bottles of beer on the wall.\n",
      "\n",
      "21 bottles of beer on the wall.\n",
      "21 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "20 bottles of beer on the wall.\n",
      "\n",
      "20 bottles of beer on the wall.\n",
      "20 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "19 bottles of beer on the wall.\n",
      "\n",
      "19 bottles of beer on the wall.\n",
      "19 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "18 bottles of beer on the wall.\n",
      "\n",
      "18 bottles of beer on the wall.\n",
      "18 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "17 bottles of beer on the wall.\n",
      "\n",
      "17 bottles of beer on the wall.\n",
      "17 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "16 bottles of beer on the wall.\n",
      "\n",
      "16 bottles of beer on the wall.\n",
      "16 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "15 bottles of beer on the wall.\n",
      "\n",
      "15 bottles of beer on the wall.\n",
      "15 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "14 bottles of beer on the wall.\n",
      "\n",
      "14 bottles of beer on the wall.\n",
      "14 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "13 bottles of beer on the wall.\n",
      "\n",
      "13 bottles of beer on the wall.\n",
      "13 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "12 bottles of beer on the wall.\n",
      "\n",
      "12 bottles of beer on the wall.\n",
      "12 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "11 bottles of beer on the wall.\n",
      "\n",
      "11 bottles of beer on the wall.\n",
      "11 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "10 bottles of beer on the wall.\n",
      "\n",
      "10 bottles of beer on the wall.\n",
      "10 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "9 bottles of beer on the wall.\n",
      "\n",
      "9 bottles of beer on the wall.\n",
      "9 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "8 bottles of beer on the wall.\n",
      "\n",
      "8 bottles of beer on the wall.\n",
      "8 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "7 bottles of beer on the wall.\n",
      "\n",
      "7 bottles of beer on the wall.\n",
      "7 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "6 bottles of beer on the wall.\n",
      "\n",
      "6 bottles of beer on the wall.\n",
      "6 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "5 bottles of beer on the wall.\n",
      "\n",
      "5 bottles of beer on the wall.\n",
      "5 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "4 bottles of beer on the wall.\n",
      "\n",
      "4 bottles of beer on the wall.\n",
      "4 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "3 bottles of beer on the wall.\n",
      "\n",
      "3 bottles of beer on the wall.\n",
      "3 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "2 bottles of beer on the wall.\n",
      "\n",
      "2 bottles of beer on the wall.\n",
      "2 bottles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "1 bottle of beer on the wall.\n",
      "\n",
      "1 bottle of beer on the wall.\n",
      "1 bottle of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "No more bottles of beer on the wall.\n"
     ]
    }
   ],
   "source": [
    "word = \"bottles\"\n",
    "for beer_num in range(99,0,-1):\n",
    "    print(beer_num,word,\"of beer on the wall.\")\n",
    "    print(beer_num,word,\"of beer.\")\n",
    "    print(\"Take one down.\")\n",
    "    print(\"Pass it around.\")\n",
    "    if beer_num == 1:\n",
    "        print(\"No more bottles of beer on the wall.\")\n",
    "    else:\n",
    "        new_num = beer_num - 1\n",
    "        if new_num == 1:\n",
    "            word = \"bottle\"\n",
    "        print(new_num,word,\"of beer on the wall.\")\n",
    "        print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b4c021eb",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
